In a cloud server platform, when memory of a node is insufficient, a borrow request may be sent to a cloud controller, so that the cloud controller allocates memory of another node to the node. In this way, the node borrows and uses the memory of the another node as memory of the node. Usually, a node that borrows memory is referred to as a local node, and a node from which the memory is borrowed is referred to as a remote node of the local node. After the local node borrows the memory of the remote node, memory of the local node includes local memory (memory of the local node itself) and remote memory (the memory of the remote node that the local node borrows).
If the memory of the local node is still not enough after the local node borrows the memory of the remote node, the local node may choose to swap out some data in the memory of the local node to a hard disk of the local node, so as to release some memory space. In a case in which the memory of the local node is insufficient, it is impossible to perform a swap out operation only on the local memory to release local memory space, because it is impossible that no swap out operation is performed on the memory of the remote node from borrowing to destruction. Once a swap out operation is performed on the remote memory, the following process needs to be performed.
The local node needs to scan the remote memory and select, according to a particular algorithm, memory page data that needs to be swapped out of the remote memory; then performs a swap out operation on the local memory, and dumps some memory data in the local memory of the local node into the hard disk of the local node, so as to reserve storage space for the memory page data that needs to be swapped out; and then sends, by using the cloud controller, a remote memory swap out command to the remote node in which the remote memory is located, so that the remote mode transmits, to the local node by using a transmission channel, the memory page data that needs to be swapped out, and the memory page data is stored in the storage space reserved by the local node; finally, the local node stores, in the hard disk of the local node, the memory page data that needs to be swapped out and is stored in the local memory.
In the foregoing process of performing the swap out operation on the remote memory by the cloud controller, some memory page data in the remote memory needs to be transmitted to the local node, which occupies the transmission channel, causes running of a system to slow down, and increases power consumption of the system. In addition, if the memory page data that needs to be swapped out of the remote node is transmitted back to the local node, in the local memory of the local node, storage space needs to be reserved for the memory page data that needs to be swapped out, which further increases pressure on the local memory and makes memory management more complex, and further causes the running of the system to slow down and increases the power consumption of the system.